package spring6_learn.log;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class logAopService {

    @Pointcut("execution(* spring6_learn.log..save*())")
    public void save(){}
    @Pointcut("execution(* spring6_learn.log..update*())")
    public void update(){}
    @Pointcut("execution(* spring6_learn.log..delete*())")
    public void delete(){}

    @Before("save()||update()||delete()")
    public void before(JoinPoint joinPoint){
        System.out.println(joinPoint.getSignature().getName());
    }
}
